class OrderedSet(object):
    """A very simple ordered set class."""
    def __init__(self, objs=()):
        self.list = list()
        self.set  = set()
        for obj in objs:
            self.append(obj)
            
    def __contains__(self, obj):
        return obj in self.set
        
    def __iter__(self):
        return iter(self.list)
        
    def __getitem__(self, idx):
        return self.list[idx]
        
    def add(self, obj):
        if obj not in self.set:
            self.set.add(obj)
            self.list.append(obj)
            
    def pop(self):
        obj = self.list.pop()
        self.set.remove(obj)
        return obj
        
    def issuperset(self, set):
        return self.set.issuperset(set)
        